package cn.getech.data.development.controller;

import cn.getech.data.development.utils.SendEMailUtil;
import cn.getech.data.intelligence.common.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName MailController
 * @Description TODO
 * @Author Getech
 * @Date 2020/11/27 10:52
 */
@RestController
@RequestMapping("/mail")
public class MailController {


    @Autowired
    private SendEMailUtil sendEMailUtil;

    @ApiOperation("发送邮箱")
    @GetMapping("/send")
    public R sentMail(@RequestParam("to") String  to) {
        try {
            sendEMailUtil.createSimpleMail(to, "测试", "测试");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return R.ok();
    }
}
